"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var a;
(function (a_1) {
    function createArray(length, value) {
        var result = [];
        for (var i = 0; i < length; i++) {
            result[i] = value;
        }
        return result;
    }
    var res = createArray(4, 'x');
    console.log(res);
    function sum() {
        var args2 = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            args2[_i] = arguments[_i];
        }
        var args = arguments;
        for (var i = 0; i < args.length; i++) {
            console.log(args[i]);
        }
    }
    sum(1, 2, 3, 4, 5);
    var add = function (a, b) {
        console.log('b:', b);
        return a;
    };
    add(1, 4);
    // 多个类型参数，如何在不增加中间变量的情况下，交换两个变量的值
    function swap(temp) {
        return [temp[1], temp[0]];
    }
    console.log(swap([1, '3']));
    // 默认泛型类型
    function createArray2(length, value) {
        var result = [];
        for (var index = 0; index < length; index++) {
            result[index] = value;
        }
        return result;
    }
    var a = createArray2(3, 'a');
    console.log('a:', a);
    function logger(val) {
        console.log(val.length);
    }
    logger('磊超');
    var cart = {
        list: [1, 2, 3, 4, 5]
    };
    // 泛型类型别名
    // type Cart
    // type Cart
})(a || (a = {}));
